package com.wafersystems.springbootdemo.feign;

import com.pig4cloud.pigx.common.core.constant.SecurityConstants;
import com.pig4cloud.pigx.common.core.constant.ServiceNameConstants;
import com.pig4cloud.pigx.common.core.util.R;
import com.wafersystems.springbootdemo.feign.factory.RemoteAdminServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * feign demo
 *
 * @author tandk
 * @date 2019/3/1
 */
@FeignClient(value = ServiceNameConstants.UMPS_SERVICE, fallbackFactory = RemoteAdminServiceFallbackFactory.class)
public interface RemoteAdminService {
  /**
   * 参数feign调用
   *
   * @param name 名称
   * @return R
   */
  @GetMapping("/test/feign")
  R<String> feign(@RequestParam("name") String name, @RequestHeader(SecurityConstants.FROM) String from);

}
